<template>
  <!-- 头部路由导航条 -->
  <div class="canvas">
    <div class="nav">
      <div class="nav-left">
        <img src="@/assets/logo@3xrenew3.png" alt="" />
        <router-link
          class="item-a"
          :class="{
            action: idx == 1,
          }"
          to="/resource"
          @click="idx = 1"
          >资源</router-link
        >

        <router-link
          class="item-a"
          :class="{
            action: idx == 2,
          }"
          to="/course"
          @click="idx = 2"
          >课程</router-link
        >

        <router-link
          class="item-a"
          :class="{
            action: idx == 3,
          }"
          to="/practiceRoom"
          @click="idx = 3"
          >练习室</router-link
        >

        <router-link
          class="item-a"
          :class="{
            action: idx == 4,
          }"
          to="/interflow"
          @click="idx = 4"
          >交流</router-link
        >

        <router-link
          class="item-a"
          :class="{
            action: idx == 5,
          }"
          to="/my"
          @click="idx = 5"
          >我的</router-link
        >
      </div>
      <div class="nav-right">
        <a class="item-a" href="javascript:;">下载App</a>

        <a class="item-a" href="javascript:;">发布</a>

        <a class="item-a" href="javascript:;">登录</a>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const idx = ref(1);
</script>

<style scoped>
.canvas {
  width: 100%;
  height: 60px;
  /* background-color: aquamarine; */
  box-shadow: 4px 0 9px #c1c1c1;
  margin-bottom: 10px;
  padding: 10px 0 0;
  z-index: 1;
}
.canvas .nav {
  width: 1200px;
  min-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.canvas .nav .nav-left {
  display: flex;
  align-items: center;
}
.canvas .nav .nav-left img {
  /* <!-- 128*30 --> */
  width: 128px;
  height: 30px;
}
.canvas .nav .nav-left .item-a {
  padding: 12px 10px;
  font-size: 18px;
  color: #111;
  text-decoration: none;
  margin-left: 40px;
}
.canvas .nav .nav-left .item-a.action {
  color: #f93684;
}
.canvas .nav .nav-right {
  display: flex;
  align-items: center;
}
.canvas .nav .nav-right .item-a {
  padding: 12px 10px;
  font-size: 18px;
  color: #111;
  text-decoration: none;
  margin-left: 40px;
}
</style>
